package com.vkmessenger.gui.activities;

import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TabHost;
import com.vkmessenger.R;
import com.vkmessenger.gui.activities.contacts.ContactsActivity;
import com.vkmessenger.gui.activities.messages.MessagesActivity;
import com.vkmessenger.gui.activities.search.SearchActivity;
import com.vkmessenger.gui.activities.settings.SettingsActivity;
import com.vkmessenger.gui.components.TabButtonFactory;

/**
 * Created by IntelliJ IDEA.
 * User: Evgeniy Krasko
 * Date: 28.05.12
 * Time: 1:43
 */
public class ContainerActivity extends TabActivity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        TabHost tabHost = getTabHost();
        TabHost.TabSpec spec;
        Intent intent;


        View view = TabButtonFactory.getBottomTabButton(getApplicationContext(), R.drawable.button_messages, "Cообщения");
        intent = new Intent().setClass(this, MessagesActivity.class);
        spec = tabHost.newTabSpec("messages").setIndicator(view).setContent(intent);
        tabHost.addTab(spec);

        view = TabButtonFactory.getBottomTabButton(getApplicationContext(), R.drawable.button_contacts, "Контакты");
        intent = new Intent().setClass(this, ContactsActivity.class);
        spec = tabHost.newTabSpec("contacts").setIndicator(view).setContent(intent);
        tabHost.addTab(spec);

        view = TabButtonFactory.getBottomTabButton(getApplicationContext(), R.drawable.button_search, "Поиск");
        intent = new Intent().setClass(this, SearchActivity.class);
        spec = tabHost.newTabSpec("search").setIndicator(view).setContent(intent);
        tabHost.addTab(spec);

        view = TabButtonFactory.getBottomTabButton(getApplicationContext(), R.drawable.button_settings, "Настройки");
        intent = new Intent().setClass(this, SettingsActivity.class);
        spec = tabHost.newTabSpec("settings").setIndicator(view).setContent(intent);
        tabHost.addTab(spec);

        tabHost.setCurrentTab(0);
    }

}
